package com.itheima;

import java.util.ArrayList;
import java.util.List;

public class Main {
    public static void main(String[] args) {
        List<Integer> myList = new ArrayList<>();
        myList.add(2);
        myList.add(4);
        myList.add(5);

        int maxVal = myList.stream().max(Integer::compare).get();
        List<Integer> result = new ArrayList<>();
        for (int i = 1; i <= maxVal; i++) {
            if (!myList.contains(i)) {
                result.add(i);
            }
        }

        System.out.println(result);
    }
}
